module.exports._init = function (that) {
  let path = that.route;
  let complainItems = ['敏感信息', '政治违法', '淫秽色情', '人身攻击', '广告营销', '其他'];
  that._saveData("_COMPLAIN_/items", complainItems);
  /**
   * complainModalSubmit - 举报提交
   * type 1 - trend 2 - remark
   */
  that.complainModalSubmit = function (e) {
    let requestData = {};
    let path = e.detail.value.path;
    let data = that._getData(path);
    console.log(data);

    requestData['type'] = data.sender_uid ? 1 : 2;
    requestData['cid'] = data.id;
    requestData['preview'] = data.content.text;
    requestData['reason'] = complainItems[e.detail.value.index] + ":" + e.detail.value.content;

    console.log(requestData);
    function addSuccess() {
      wx.showToast({ title: '举报成功', });
      this._saveData('cache/showComplainModal', 2);
    }
    this._request("complain-cases").add(requestData, { success: addSuccess.bind(this) });
  }.bind(that);
}
